var http = require('http');

function start(route) {
  http.createServer(function (request, response) {
    var data_handler = require('./data_handler');
    if (request.url == '/upload') {
      route(request, response, {});
    } else {
      data_handler.load_parameters(request, response, route);
    }
  }).listen(8124);
  
  console.log('Server running at http://127.0.0.1:8124/');
}

exports.start = start;
